<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>zlx提交表单到百度</title>

</head>
<body>
<form action="https://www.baidu.com/" method="post" onsubmit="return aaa()">
    <p>
        <span>用户名</span><input type="text" id="username" name="username">
    </p>
    <p>
        <span>密码:</span><input type="password" id="input-password" name="password">
    </p>
    <input type="hidden" id="md5-password" name="password">
    <button type="submit">准备提交</button>
</form>
<script>
    function aaa(){
    alert("发起提交");
    var uname=document.getElementById("username");
    var password=document.getElementById("input-password");
    var md5Pw=document.getElementById("md5-password");
    md5Pw.value=md5(password.value);
    return ture;


    }
</script>
</body>
</html>